package com.ruoyi.common.utils;

/**
 * AUTHOR : CREATED BY DALE MAO ON 2018/7/12
 * DESCRIPTION:
 * Time:2018/7/12 ----- ${Time}
 **/
public class OrderUtils {


    public  static  String  makeOrderId(Long userid){
        Long thisTime = System.currentTimeMillis()/1000;
        String finalString =userid.toString()+thisTime;
        return finalString;
    }

    public  static  String  makeSalesOrderId(Long userid,Long productId,Long businessId){
        Long thisTime = System.currentTimeMillis()/1000;
        String finalString ="sale"+productId.toString()+businessId+userid.toString()+thisTime;
        String orderNum=MD5Utils.getMd5(finalString);
        return orderNum;
    }

    public  static  String  makeOrderNum(Long companyid,Long serviceId,Long SpecificationId){
        Long thisTime = System.currentTimeMillis()/1000;
        String finalString ="sale"+serviceId.toString()+SpecificationId+companyid.toString()+thisTime;
        String orderNum=MD5Utils.getMd5(finalString);
        return orderNum;
    }

    public  static  String  makeThirdOrderNum(Long serviceId,Long SpecificationId){
        Long thisTime = System.currentTimeMillis()/1000;
        String finalString ="thirdSale"+serviceId.toString()+SpecificationId+thisTime;
        String orderNum=MD5Utils.getMd5(finalString);
        return orderNum;
    }

    public  static  String  makeRebateOrderId(Long userid,Long productId,Long businessId){
        Long thisTime = System.currentTimeMillis()/1000;
        String finalString ="rebate"+productId.toString()+businessId+userid.toString()+thisTime;
        String orderNum=MD5Utils.getMd5(finalString);
        return orderNum;
    }






}
